from django.db import models

class file_upload(models.Model):
    '''
    文件上传
    '''

    name = models.CharField(max_length=200,verbose_name="文件名称",help_text="文件名称")
    file_md5 = models.CharField(max_length=100,null=True,blank=True,verbose_name="文件md5值",help_text="文件md5值")
    file_url = models.TextField(verbose_name="文件地址",help_text="文件地址")
    file_type = models.CharField(max_length=50, verbose_name="文件类型", help_text="文件类型")
    child_type = models.CharField(max_length=50,null=True, blank=True, verbose_name="子类型", help_text="子类型")
    env = models.CharField(default="prod",max_length=20,null=True,blank=True,verbose_name="集群",help_text="集群")
    create_time = models.DateTimeField(auto_now_add=True,verbose_name="生成日期",help_text="生成日期")
    update_time = models.DateTimeField(auto_now=True,verbose_name="更新时间",help_text="更新时间")


    class Meta:
        verbose_name = "文件上传"
        verbose_name_plural = verbose_name
        ordering = ['id']
        db_table = "upload_file"

    def __str__(self):
        return self.name